<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8">
    <title>添加体制测试</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <style>
        .form-items-show {
            display: none;
        }
    </style>
</head>

<body>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">

            <div class="layui-col-md11">

                <div class="layui-card">
                    <div class="layui-card-header">添加体质测试类型 <a class="layui-btn layui-btn-primary" href="javascript:history.go(-1);">返回</a></div>
                    <div class="layui-card-body">
                        <form class="layui-form" action="" lay-filter="component-form-element" id="component-form-group">




                            <div class="layui-row layui-col-space10 layui-form-item">

                                <div class="layui-col-lg3">
                                    <label class="layui-form-label"> 类型名称</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="content" lay-verify="required" placeholder="输入新的类型名称" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-col-lg3">
                                    <label class="layui-form-label"> 身体信息1</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="height" lay-verify="required" placeholder="一般填身高" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-col-lg3">
                                    <label class="layui-form-label">身体信息2</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="width" lay-verify="required" placeholder="一般填体重" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-col-lg3">
                                    <label class="layui-form-label"> 身体信息3</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="abduction" lay-verify="required" placeholder="臂展" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-col-lg3">
                                    <label class="layui-form-label">身体信息4</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="fingerSpan" lay-verify="required" placeholder="手指跨度" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">项目名称1</label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="singForward" placeholder="比如：坐位体前屈" lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">项目名称2</label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="roundTrip" placeholder="15米节奏往返跑" lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">项目名称3</label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="courtSprint" placeholder="3/4球场冲刺跑" lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">项目名称4</label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="restrtedArea" placeholder="禁区往返跑" lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">项目名称5</label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="klingWing" placeholder="跪姿抛球" lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">项目名称6</label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="verticalJump" placeholder="垂直跳跃" lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">项目名称7</label>
                                <div class="layui-input-block">
                                    <textarea type="text" name="continJump" placeholder="30s连续跳跃" lay-verify="required" class="layui-textarea"></textarea>
                                </div>
                            </div>




                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="component-form-element">立即提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                    <a class="layui-btn layui-btn-primary" href="javascript:history.go(-1);">返回</a>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="../../../layuiadmin/jquery/jquery-1.11.1.min.js"></script>
    <script src="../../../layuiadmin/url.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>

    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form'], function() {
            var $ = layui.$,
                admin = layui.admin,
                element = layui.element,
                form = layui.form;





            form.render(null, 'component-form-element');
            element.render('breadcrumb', 'breadcrumb');

            form.on('submit(component-form-element)', function(data) {


                var content = data.field.content;
                var height = data.field.height;
                var width = data.field.width;
                var abduction = data.field.abduction;
                var fingerSpan = data.field.fingerSpan;
                var singForward = data.field.singForward;
                var roundTrip = data.field.roundTrip;
                var courtSprint = data.field.courtSprint;
                var restrtedArea = data.field.restrtedArea;
                var klingWing = data.field.klingWing;
                var verticalJump = data.field.verticalJump;
                var continJump = data.field.continJump;



                $.ajax({
                    type: "POST",
                    dataType: "json",
                    url: applicationUrl + 'constionparent/api/inser',
                    data: {
                        content: content,
                        height: height,
                        width: width,
                        abduction: abduction,
                        fingerSpan: fingerSpan,
                        singForward: singForward,
                        roundTrip: roundTrip,
                        courtSprint: courtSprint,
                        restrtedArea: restrtedArea,
                        klingWing: klingWing,
                        verticalJump: verticalJump,
                        continJump: continJump,

                    },
                    success: function(result) {
                        layer.msg(result.msg);
                        $("#component-form-group")[0].reset();
                        layui.form.render();

                    },
                    error: function(result) {
                        layer.msg(result.msg);

                        layui.form.render();
                    }

                })
                return false;
            });
        });
    </script>
</body>

</html>